-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add related values #6619
Conversation
b935c5c
to
ce78d4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 45b423e in 2 minutes and 9 seconds
More details
- Looked at
372
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
9
drafted comments based on config settings.
1. pkg/query-service/app/parser.go:377
- Draft comment:
Consider replacing the literal 30000000000 with a named constant (e.g. bufferDuration) to clarify that it represents 30 seconds in nanoseconds. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. pkg/query-service/model/v3/v3.go:995
- Draft comment:
There is commented-out validation code for time aggregation (lines 995-1007). If it's no longer needed, please remove it; otherwise add a comment explaining why it’s retained. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. pkg/query-service/model/v3/v3.go:1129
- Draft comment:
In CompositeQuery.Clone, deep cloning of slices (e.g. for BuilderQueries, ClickHouseQueries, PromQueries) is handled but GroupBy (if ever mutable) may need cloning for safety. Verify whether a shallow copy suffices. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. pkg/query-service/app/parser.go:784
- Draft comment:
Consider replacing the numeric time offsets (subtracting 6*2 hours from StartTimeMillis and adding 6 hours to EndTimeMillis) with a named constant for clarity. - Reason this comment was not posted:
Marked as duplicate.
5. pkg/query-service/app/parser.go:810
- Draft comment:
The variable validation in validateExpressions() loops over BuilderQueries comparing each query’s Expression with each variable extracted from the expression. This approach may be brittle if variable names differ from query expressions. Consider validating against an explicit set of expected variable names (e.g. from the Variables map). - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. pkg/query-service/app/parser.go:367
- Draft comment:
A magic constant (30000000000) is used to adjust the time in parseTimeMinusBufferStr(). Define a named constant (e.g. bufferDuration) to improve readability and maintainability. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. pkg/query-service/model/v3/v3.go:433
- Draft comment:
The Clone method for QueryRangeParamsV3 shallow-copies the Variables map. If the map is mutable and may be updated later, consider performing a deep copy to avoid unintended sharing. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
8. pkg/query-service/model/v3/v3.go:1363
- Draft comment:
In Point's MarshalJSON and UnmarshalJSON methods, the numeric value is encoded as a string. Ensure that encoding point values as strings is intentional, as downstream consumers might expect numeric JSON values. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
9. pkg/query-service/model/v3/v3.go:995
- Draft comment:
There is commented-out code in BuilderQuery.Validate (lines ~995–1012) concerning aggregate operator and time aggregation. If it is no longer needed, please remove it to clean up the code. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_VllatKRRhWjPgch2
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 2cb249d in 1 minute and 9 seconds
More details
- Looked at
62
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. pkg/query-service/model/v3/v3.go:310
- Draft comment:
Renamed field from selectedAttributeValues to existingFilterItems. Ensure clients consuming the API are updated. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
This comment is asking the PR author to ensure that clients consuming the API are updated, which violates the rule against asking the author to ensure behavior is intended or tested. It doesn't provide a specific code suggestion or ask for a specific test to be written.
2. pkg/query-service/model/v3/v3.go:337
- Draft comment:
Error message now refers to existingFilterItems instead of selectedAttributeValues. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
This comment is purely informative and does not provide any actionable feedback or suggestions for improvement. It simply states a change that has been made without indicating any potential issues or areas for improvement.
3. pkg/query-service/model/v3/v3.go:419
- Draft comment:
New field 'RelatedValues' added. Consider documenting its intended use and potential recursion limits. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. pkg/query-service/model/v3/v3.go:990
- Draft comment:
Remove or clean up the commented‐out validation block in BuilderQuery.Validate to improve code clarity. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. pkg/query-service/model/v3/v3.go:271
- Draft comment:
AttributeKeyDataType.Validate accepts only primitive types; consider whether array types should be allowed. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. pkg/query-service/model/v3/v3.go:920
- Draft comment:
BuilderQuery.Clone shallow-copies slices (e.g. GroupBy and Functions). Verify that mutable maps (e.g. NamedArgs inside Functions) are safe from unintended mutations. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. pkg/query-service/model/v3/v3.go:4570
- Draft comment:
GetTimeSeriesResultV3 uses reflection to allocate scan targets; consider optimizing this for high‐performance queries. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
8. pkg/query-service/model/v3/v3.go:1363
- Draft comment:
Point.MarshalJSON converts the numeric value to a string; ensure consumers expecting a numeric type are properly handled. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_Na17JvqDiIFwC6IU
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
This reverts commit c5219ac.
This reverts commit c5219ac.
Summary
Part of #6934
Example:
request payload
The
selectedAttributeValues
part sends the selected value of other attributes that exist. In the above request payload, the namespace selected value is sent. In the response, we send pods from all namespaces and also related pod names from existing selection. On the UI, we surface the related values at the top before showing all the values.The response
Important
Adds support for fetching related attribute values in query service, including new request handling and database query logic.
FetchRelatedValues()
inreader.go
to fetch related attribute values based on existing filters.GetLogAttributeValues()
andGetTraceAttributeValues()
inreader.go
to include related values in the response./autocomplete/attribute_values
inhttp_handler.go
to handle related values.StartTimeMillis
andEndTimeMillis
toFilterAttributeValueRequest
inv3.go
.RelatedValues
field toFilterAttributeValueResponse
inv3.go
.Validate()
method inFilterAttributeValueRequest
inv3.go
.parseFilterAttributeValueRequestBody()
inparser.go
to parse POST request body for attribute values.defaultMetadataDB
anddefaultMetadataTable
inoptions.go
.This description was created by
for 2cb249d. It will automatically update as commits are pushed.